home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
qbbs
/
eft130.zip
/
ARCHEAD.BTM
next >
Wrap
Text File
|
1991-11-24
|
7KB
|
220 lines
@echo off
rem THIS MAY ONLY RUN WITH *** 4DOS V 4.x !!! ***
rem ╔══════════════════════════════════════════════════════════════════════════╗
rem ║ ║
rem ║ ArcHead V 1.0 BONUS Archive header and unwanted files manipulator ║
rem ║ for use with Enhanced File Transfer ║
rem ║ ║
rem ║ Variables to adapt to your system: ║
rem ║ ║
rem ║ headfilename ... name of PD and CUG header file, will be inserted ║
rem ║ as archive header ║
rem ║ ║
rem ║ pd_pkzip/ ║
rem ║ cug_pkzip ... Name of PKZIP.EXE for PD and CUG areas, so you ║
rem ║ can have two different AV strings... ║
rem ║ Simply set to "PKZIP" if not wanted. ║
rem ║ ║
rem ║ unwantedfname ... plain ASCII file contains names of unwanted ║
rem ║ files (e.g. commericals from other BBSs), one file ║
rem ║ per line. All files listed here will be erased ║
rem ║ from the archive. ║
rem ║ ║
rem ║ Note! Exclamation mark parameter "!" great for usage under ║
rem ║ EFT: Switches to non color batch mode ,so that ArcHead will stay ║
rem ║ in EFT window. Example: ║
rem ║ ║
rem ║ ArcHead C! pct7_1v8.zip pct7_2v8.zip new*.arj ║
rem ║ ║
rem ╚══════════════════════════════════════════════════════════════════════════╝
setlocal
set version=1.0
rem ***************************************************************************
rem Set this to the path were ArcHead shall find your arcers
rem NO TRAILING \
rem ***************************************************************************
set arcpath=x:\dos\arc
rem ***************************************************************************
rem Do you have a special AV coded PKZIP for your closed areas?
rem If so set it here
rem ***************************************************************************
set cug_pkzip=pkzipc.exe
rem ***************************************************************************
rem This is the normal PKZIP.
rem ***************************************************************************
set pd_pkzip=pkzip.exe
if %@len[%1] EQ 1 goto headparmok
if %@len[%1] EQ 2 goto headparmok
goto noheadparm
:headparmok
set unwantedfname=%arcpath\unwanted.fil
set headfilename=x:\dos\utils\w.i
if (%@substr[%@upper[%1],0,1]) == (C) set headfilename=x:\dos\utils\wi.cug
if (%@substr[%@upper[%1],1,1]) == (!) set quiet=ON
set lineheader =x:\dos\utils\w.i2
gosub archeadline
iff "%quiet" NE "ON" then^
color green on black^
echo.^
echo ArcHead configuration:^
echo Arcers in %arcpath^
echo Unwanted filenames in %unwantedfname^
echo Headerfile %headfilename^
echo.^
endiff
if (%2) == () goto nofilenames
:loop
if (%2) == () goto end
iff (%@ext[%2]) NE () then^set parm=%@name[%2].%@ext[%2]^
else^set parm=%@name[%2]^
endiff
iff (%@path[%2]) NE () then^pushd^cdd %@substr[%@path[%2],0,%@eval[%@len[%@path[%2]]-1]] len^endiff
if (%@ext[%parm]) == () goto noextension
:extension
for %filename in (%parm) do gosub %@ext[%filename]
goto goloop
:noextension
for %%filename in (%parm.zip %parm.lzh %parm.ice %parm.arj %parm.zoo %parm.dwc %parm.sdn %parm.pak %parm.arc) do gosub %@ext[%filename]
:goloop
if (%@path[%2]) NE () popd
shift
goto loop
:noheadparm
gosub archeadline
iff (%quiet) == () color bright green on black
text
Syntax: ArcHead {C|P}{!} [[Lw:][\Pfad\Filename.[Ext]] ...]
! ! !
CUG / PUBLIC header
! !
! File(s)
!
Optional exclamation mark switches to
non color batch mode
endtext
iff (%quiet) == () color white on black
goto end
:nofilenames
for %filename in (*.zip *.lzh *.ice *.arj *.zoo *.dwc *.sdn *.pak *.arc) do gosub %@ext[%filename]
goto end
:zip
gosub display_del
iff (%@substr[%@upper[%1],0,1]) == (C) then^
%arcpath\%cug_pkzip -k -d -! %filename @%unwantedfname > NUL:^
else^
%arcpath\%pd_pkzip -k -d -! %filename @%unwantedfname > NUL:^
endiff
gosub display_header
%arcpath\%pd_pkzip -k -z %filename < %headfilename > NUL:
return
:lzh
:ice
gosub display_del
%arcpath\lha d -wd:\ -m %filename < %unwantedfname > NUL:
if (%@ext[%filename])==(ICE) ren %filename %@name[%filename].LZH
return
:arj
gosub display_del
%arcpath\arj d -yi %filename !%unwantedfname > NUL:
gosub display_header
%arcpath\arj c -yi %filename -z%headfilename > NUL:
return
:zoo
set line=1
if "" NE "%old" then unset old
:zoo_weiter
set new=%@line[%unwantedfname,%line]
if "%old" == "%new" return
%arcpath\zoo -delete %filename %new > NUL:
gosub display_status
set old=%new
set line=%@eval[%line + 1]
goto zoo_weiter
:dwc
set line=1
if "" NE "%old" then unset old
:dwc_weiter
set new=%@line[%unwantedfname,%line]
if %old == %new goto dwc_end
gosub display_status
%arcpath\dwc d! %filename %new
set old=%new
set line=%@eval[%line + 1]
goto dwc_weiter
:dwc_end
gosub display_header
%arcpath\dwc a! %filename %headfilename
%arcpath\dwc h! %filename %@name[%headfilename].%@ext[%headfilename]
return
:sdn
:pak
gosub display_del
%arcpath\pak d %filename @%unwantedfname > NUL:
gosub display_header
%arcpath\pak h %filename < %headfilename > NUL:
if (%@ext[%filename])==(SDN) ren %filename %@name[%filename].PAK
return
:arc
gosub display_del
%arcpath\pkpak -x %filename < %lineheader > NUL:
gosub display_header
%arcpath\pkpak -d %filename @%unwantedfname > NUL:
return
:display_status
echo deleting "%new" in archive %filename
return
:display_header
iff (%quiet) == () color green on black
echo inserting header %headfilename
iff (%quiet) == () color white on black
return
:display_del
iff (%quiet) == () color green on black
echo deleting files in %unwantedfname from %filename
iff (%quiet) == () color white on black
return
:archeadline
iff (%quiet) == () then^
cls^
color bright white on blue^
echo ■ ArcHead V%version Archive header and unwanted files manipulator ^
color white on black^
else^
echo ■ ArcHead V%version^
endiff
return
:end
iff (%quiet) == () color green on black
echo ■ Bye from ArcHead V%version (C) The Wizard's Inn II BBS ++49-2307-21968
iff (%quiet) == () color white on black
endlocal